package javabase.util;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateDemo {
	public static void main(String[] args) {
		Date dateUtil = new Date();
		java.sql.Date dateSql = new java.sql.Date(dateUtil.getTime());
		System.out.println(dateSql);
		
		java.sql.Timestamp dateTime = new java.sql.Timestamp(dateUtil.getTime());
		System.out.println(dateTime);
		DateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		
		java.sql.Time time = new java.sql.Time(dateUtil.getTime());
		sf.format(time);
		System.out.println(sf.format(time));
		System.out.println(time);
	}
}
